<!DOCTYPE html>
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{layout}">

<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>

    <title th:text="#{cas.mfa.simple.pagetitle}">CAS Multifactor Authentication View</title>
    <link href="../../static/css/cas.css" rel="stylesheet" th:remove="tag"/>
</head>

<body>

<main class="container mt-3 mb-3">
    <div layout:fragment="content" id="login" class="mdc-card mdc-card-content card w-lg-50 p-4 m-auto">
        <form method="post" id="fm1" th:action="@{/login}">
            <div class="banner banner-info alert alert-info my-2">
                <p th:utext="#{cas.mfa.simple.registration.email.sent}">Message Text</p>
            </div>

            <div class="banner banner-danger alert alert-danger my-2" th:if="${flowRequestContext.messageContext.hasErrorMessages()}">
                <p th:each="message : ${flowRequestContext.messageContext.allMessages}"
                   th:utext="${message.text}">Message Text</p>
            </div>


            <section class="cas-field my-3 mdc-input-group form-group">
                <div class="mdc-input-group-field mdc-input-group-field-append">
                    <div class="d-flex caps-check">
                        <label for="token" class="mdc-text-field mdc-text-field--outlined mdc-text-field--with-trailing-icon control-label">
                            <span class="mdc-notched-outline">
                                <span class="mdc-notched-outline__leading"></span>
                                <span class="mdc-notched-outline__notch">
                                    <span class="mdc-floating-label"
                                          th:utext="#{cas.mfa.simple.label.token}">Token</span>
                                </span>
                                <span class="mdc-notched-outline__trailing"></span>
                            </span>
                            <input class="mdc-text-field__input form-control pwd"
                                   type="password"
                                   name="token"
                                   id="token"
                                   size="25"
                                   autocomplete="one-time-code" required/>
                        </label>

                        <button class="reveal-password mdc-button mdc-button--raised mdc-input-group-append mdc-icon-button"
                                tabindex="-1"
                                type="button" th:title="#{screen.pm.password.toggle}">
                            <i class="mdi mdi-eye reveal-password-icon" aria-hidden="true"></i>
                        </button>
                    </div>
                    <div class="mdc-text-field-helper-line caps-warn">
                        <p class="mdc-text-field-helper-text mdc-text-field-helper-text--persistent mdc-text-field-helper-text--validation-msg text-danger">
                            <span th:utext="#{screen.capslock.on}"/>
                        </p>
                    </div>
                </div>

            </section>
            <div class="d-flex">
                <button id="registerButton" class="mdc-button mdc-button--raised me-2" accesskey="s">
                    <span class="mdc-button__label" th:text="#{screen.welcome.button.register}">Register</span>
                </button>
            </div>
            <input type="hidden" id="eventId" name="_eventId" value="submit"/>
            <input type="hidden" name="execution" th:value="${flowExecutionKey}"/>
        </form>

    </div>
</main>
</body>

</html>
